package p366;/**
 * @Author：ming
 * @Date：2023/10/14 10:03 AM
 * @Filename：lc2894
 */

/**
 * @author ming
 */
public class lc2894 {
    public int differenceOfSums(int n, int m) {
        int sum1=0;
        int sum2=0;
        for (int i = 1; i <=n; i++) {
            if(i%m==0){
                sum2+=i;
            }else {
                sum1+=i;
            }
        }
        return sum1-sum2;
    }
}
